Skip to content

test: add unit tests for formatErr() unauthorized error hints - #322

Merged
zeroshade merged 2 commits into
fix-315-restore-unauthorized-hintsfrom
copilot/sub-pr-321
Feb 23, 2026
Merged

test: add unit tests for formatErr() unauthorized error hints#322
zeroshade merged 2 commits into
fix-315-restore-unauthorized-hintsfrom
copilot/sub-pr-321

Conversation

Copilot AI commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

formatErr() output changed for dbc.ErrUnauthorized and dbc.ErrUnauthorizedColumnar in #321, but no tests covered the hint lines appended to those errors.

Changes

  • cmd/dbc/main_test.go: Added TestFormatErr covering all four cases — direct and fmt.Errorf-wrapped variants of both sentinel errors — asserting the output contains both the original error text and the expected hint:
fmt.Errorf("operation failed: %w", dbc.ErrUnauthorized)
// → contains "not authorized" + "Did you run `dbc auth login`?"

fmt.Errorf("operation failed: %w", dbc.ErrUnauthorizedColumnar)
// → contains "not authorized to access" + "active license" + "support@columnar.tech"

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: zeroshade <555095+zeroshade@users.noreply.github.com>
Copilot AI changed the title [WIP] Update to address feedback on restoring hints for unauthorized users test: add unit tests for formatErr() unauthorized error hints Feb 23, 2026
Copilot AI requested a review from zeroshade February 23, 2026 16:02
@zeroshade
zeroshade marked this pull request as ready for review February 23, 2026 16:08
@zeroshade
zeroshade merged commit b0669d5 into fix-315-restore-unauthorized-hints Feb 23, 2026
11 of 13 checks passed
@zeroshade
zeroshade deleted the copilot/sub-pr-321 branch February 23, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants